import request from '@/utils/request'
export const getRoleList = (page, pagesize) => {
  return request.get('/sys/role', {
    params: {
      page,
      pagesize
    }
  })
}
export const addRole = (data) => {
  return request.post('/sys/role', data)
}
export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}
export const deleteRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}
export const getEnableRole = () => {
  return request.get('/sys/role/list/enabled')
}
export const getRole = (id) => {
  return request.get(`/sys/role/${id}`)
}
export const assignPerm = (id, permIds) => {
  return request.put('/sys/role/assignPrem', {
    id,
    permIds
  })
}
